<template>
	<view class="">
		<navigator url="../Login/Login">去登录</navigator>
		<!-- 底部导航栏 -->
		<u-tabbar
		    :value="currents"
		    :show="true"
		    :border-top="true"
		    :list="list"
			:mid-button="true"
			inactive-color="#909399"
			activeColor="#5098FF"
			@change='change'
		></u-tabbar>
	</view>
</template>

<script>
	export default {
		name:'footNav',
		props:{
			currents:{
				type:Number
			}
		},
		data() {
			return {	
				list: [{
						iconPath: "home",
						selectedIconPath: "home-fill",
						text: '首页',
						count: 2,
						isDot: true,
						customIcon: false,
					},
					{
							iconPath: "map",
							selectedIconPath: "map-fill",
							text: '地图',
							customIcon: false,
						},
					{
						iconPath: "plus-circle",
						selectedIconPath: "plus-circle",
						text: '发布',
						midButton: true,
						customIcon: false,
					},
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '哈哈',
						customIcon: false,
					},
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '我的',
						count: 23,
						isDot: false,
						customIcon: false,
					},
				],
				
			}
		},
		
		methods: {
			beforeSwitch(index) {
				return true;
			},
			change(index){
				if(index==2){
					this.$u.route({
						url:'/pages/Post/Post'
					})
				}else if(index==0){
					this.$u.route({
						url:'/pages/index/index'
					})
				}else if(index==3){
					this.$u.route({
						url:'/pages/Person/Person'
					})
				}else if(index==4){//获取个人信息
					this.$api.userMsg().then(
						(res) => {		
							this.$u.vuex('vuex_myMsg', res)
							uni.setStorageSync('myMsg',JSON.stringify(res))
						}
					)
					this.$u.route({
						url:'/pages/Person/Person'
					})
				}else if(index==1){
					this.$u.route({
						url:'/pages/map/map'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
	
</style>
